package com.app.controller;

import com.app.mapper.suzhou.YouthJobInvestigateMapper;
import com.app.model.YouthJobInvestigateModel;
import com.app.service.YouthJobInvestigateService;
import com.app.util.CommonHelp;
import com.app.util.PoiWordTools;
import com.app.util.Result;
import com.app.util.WordUtil;
import com.app.vo.YouthJobInvestigateVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.data.PictureRenderData;
import org.apache.poi.ooxml.POIXMLDocumentPart;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xwpf.usermodel.XWPFChart;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.jeecgframework.poi.excel.ExcelExportUtil;
import org.jeecgframework.poi.excel.entity.TemplateExportParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.web.bind.annotation.*;

import java.io.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Author: N
 * @Date: 2022/10/29 15:26
 */
@RestController
@RequestMapping("/")
public class YouthJobInvestigateController {

    @Autowired
    YouthJobInvestigateMapper youthJobInvestigateMapper;
    @Autowired
    YouthJobInvestigateService youthJobInvestigateService;


    /**
     * 青年问卷调查
     *
     * @param model
     * @param request
     * @return
     */
    @GetMapping("/getYouthJobInvestigateList")
    public Result<Object> getYouthJobInvestigateList(
            YouthJobInvestigateModel model,
            HttpServletRequest request) {
        model.setPage((model.getPage() - 1) * model.getLimit());
        List<YouthJobInvestigateModel> modelList = youthJobInvestigateMapper.getModelList(model);
        int count = youthJobInvestigateMapper.getModelCount(model);
        YouthJobInvestigateVo vo = new YouthJobInvestigateVo();
        vo.setList(modelList);
        vo.setCount(count);
        return Result.success(vo);
    }

    /**
     * 青年问卷调查
     *
     * @param id
     * @param request
     * @return
     */
    @GetMapping("/getYouthJobInvestigateById")
    public Result<Object> getYouthJobInvestigateById(
            Integer id, HttpServletRequest request) {
        YouthJobInvestigateModel model = youthJobInvestigateMapper.selectById(id);
        return Result.success(model);
    }

    //就业满意度 非常满意 比较满意 一般 比较不满意 非常不满意
    @GetMapping("/jobSatisfaction")
    public Result<Object> jobSatisfaction() {
        List<YouthJobInvestigateVo> vos = new ArrayList<>();
        QueryWrapper<YouthJobInvestigateModel> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("this_work_satisfied", "非常满意");
        Integer count1 = youthJobInvestigateMapper.selectCount(queryWrapper1);
        YouthJobInvestigateVo vo1 = new YouthJobInvestigateVo();
        vo1.setName("非常满意");
        vo1.setValue(count1);
        vos.add(vo1);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("this_work_satisfied", "比较满意");
        Integer count2 = youthJobInvestigateMapper.selectCount(queryWrapper2);
        YouthJobInvestigateVo vo2 = new YouthJobInvestigateVo();
        vo2.setName("比较满意");
        vo2.setValue(count2);
        vos.add(vo2);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("this_work_satisfied", "一般");
        Integer count3 = youthJobInvestigateMapper.selectCount(queryWrapper3);
        YouthJobInvestigateVo vo3 = new YouthJobInvestigateVo();
        vo3.setName("一般");
        vo3.setValue(count3);
        vos.add(vo3);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.like("this_work_satisfied", "比较不满意");
        Integer count4 = youthJobInvestigateMapper.selectCount(queryWrapper4);
        YouthJobInvestigateVo vo4 = new YouthJobInvestigateVo();
        vo4.setName("比较不满意");
        vo4.setValue(count4);
        vos.add(vo4);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper5 = new QueryWrapper<>();
        queryWrapper5.like("this_work_satisfied", "非常不满意");
        Integer count5 = youthJobInvestigateMapper.selectCount(queryWrapper5);
        YouthJobInvestigateVo vo5 = new YouthJobInvestigateVo();
        vo5.setName("非常不满意");
        vo5.setValue(count5);
        vos.add(vo5);
        return Result.success(vos);
    }

    //更换工作的次数
    @GetMapping("/workCount")
    public Result<Object> workCount() {
        QueryWrapper<YouthJobInvestigateModel> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("work_count", "一直没换过");
        Integer count1 = youthJobInvestigateMapper.selectCount(queryWrapper1);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("work_count", "换过1次");
        Integer count2 = youthJobInvestigateMapper.selectCount(queryWrapper2);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("work_count", "换过2次");
        Integer count3 = youthJobInvestigateMapper.selectCount(queryWrapper3);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.like("work_count", "换过3次");
        Integer count4 = youthJobInvestigateMapper.selectCount(queryWrapper4);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper5 = new QueryWrapper<>();
        queryWrapper5.like("work_count", "换过3次以上");
        Integer count5 = youthJobInvestigateMapper.selectCount(queryWrapper5);
        String[] workName = {"一直没换过", "换过1次", "换过2次", "换过3次", "换过3次以上"};
        Integer[] workCount = {count1, count2, count3, count4, count5};
        YouthJobInvestigateVo vo = new YouthJobInvestigateVo();
        vo.setWorkName(workName);
        vo.setWorkCount(workCount);
        return Result.success(vo);
    }

    //失业人员求职信心
    @GetMapping("/isConfidenceGetWork")
    public Result<Object> isConfidenceGetWork() {
        List<YouthJobInvestigateVo> vos = new ArrayList<>();
        QueryWrapper<YouthJobInvestigateModel> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("is_confidence_get_work", "非常有信心");
        Integer count1 = youthJobInvestigateMapper.selectCount(queryWrapper1);
        YouthJobInvestigateVo vo1 = new YouthJobInvestigateVo();
        vo1.setName("非常有信心");
        vo1.setValue(count1);
        vos.add(vo1);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("is_confidence_get_work", "比较有信心");
        Integer count2 = youthJobInvestigateMapper.selectCount(queryWrapper2);
        YouthJobInvestigateVo vo2 = new YouthJobInvestigateVo();
        vo2.setName("比较有信心");
        vo2.setValue(count2);
        vos.add(vo2);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("is_confidence_get_work", "一般");
        Integer count3 = youthJobInvestigateMapper.selectCount(queryWrapper3);
        YouthJobInvestigateVo vo3 = new YouthJobInvestigateVo();
        vo3.setName("一般");
        vo3.setValue(count3);
        vos.add(vo3);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.like("is_confidence_get_work", "比较没信心");
        Integer count4 = youthJobInvestigateMapper.selectCount(queryWrapper4);
        YouthJobInvestigateVo vo4 = new YouthJobInvestigateVo();
        vo4.setName("比较没信心");
        vo4.setValue(count4);
        vos.add(vo4);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper5 = new QueryWrapper<>();
        queryWrapper5.like("is_confidence_get_work", "非常没信心");
        Integer count5 = youthJobInvestigateMapper.selectCount(queryWrapper5);
        YouthJobInvestigateVo vo5 = new YouthJobInvestigateVo();
        vo5.setName("非常没信心");
        vo5.setValue(count5);
        vos.add(vo5);
        return Result.success(vos);
    }

    //失业人员求职面临的主要困难
    @GetMapping("/getWorkDifficulty")
    public Result<Object> getWorkDifficulty() {
        QueryWrapper<YouthJobInvestigateModel> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("get_work_difficulty", "经济不景气， 岗位需求少");
        Integer count1 = youthJobInvestigateMapper.selectCount(queryWrapper1);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("get_work_difficulty", "有岗位需求，但满足自己要求的少");
        Integer count2 = youthJobInvestigateMapper.selectCount(queryWrapper2);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("get_work_difficulty", "不知道怎样获得就业信息");
        Integer count3 = youthJobInvestigateMapper.selectCount(queryWrapper3);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.like("get_work_difficulty", "学历、年龄、性别方面收到区别对待");
        Integer count4 = youthJobInvestigateMapper.selectCount(queryWrapper4);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper5 = new QueryWrapper<>();
        queryWrapper5.like("get_work_difficulty", "不了解企业用人标准");
        Integer count5 = youthJobInvestigateMapper.selectCount(queryWrapper5);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper6 = new QueryWrapper<>();
        queryWrapper6.like("get_work_difficulty", "专业知识、能力水平欠缺");
        Integer count6 = youthJobInvestigateMapper.selectCount(queryWrapper6);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper7 = new QueryWrapper<>();
        queryWrapper7.like("get_work_difficulty", "求职方法与求职技巧掌握不够");
        Integer count7 = youthJobInvestigateMapper.selectCount(queryWrapper7);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper8 = new QueryWrapper<>();
        queryWrapper8.like("get_work_difficulty", "专业不对口");
        Integer count8 = youthJobInvestigateMapper.selectCount(queryWrapper8);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper9 = new QueryWrapper<>();
        queryWrapper9.like("get_work_difficulty", "其他");
        Integer count9 = youthJobInvestigateMapper.selectCount(queryWrapper9);
        String[] workName = {"经济不景气， 岗位需求少", "有岗位需求，但满足自己要求的少", "不知道怎样获得就业信息", "学历、年龄、性别方面收到区别对待", "不了解企业用人标准", "专业知识、能力水平欠缺", "求职方法与求职技巧掌握不够", "专业不对口", "其他"};
        Integer[] workCount = {count1, count2, count3, count4, count5, count6, count7, count8, count9};
        YouthJobInvestigateVo vo = new YouthJobInvestigateVo();
        vo.setWorkName(workName);
        vo.setWorkCount(workCount);
        return Result.success(vo);
    }

    //未就业人员精神状态
    @GetMapping("/getMentalityStat")
    public Result<Object> getMentalityStat() {
        QueryWrapper<YouthJobInvestigateModel> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("mentality", "精神饱满，没有压力，能游刃有余处理各类事情");
        Integer count1 = youthJobInvestigateMapper.selectCount(queryWrapper1);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("mentality", "有点压力，但能自我应对");
        Integer count2 = youthJobInvestigateMapper.selectCount(queryWrapper2);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("mentality", "有一定压力，感觉有精力透支的情况");
        Integer count3 = youthJobInvestigateMapper.selectCount(queryWrapper3);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.like("mentality", "压力较大，对生活或工作上的事情疲于应付");
        Integer count4 = youthJobInvestigateMapper.selectCount(queryWrapper4);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper5 = new QueryWrapper<>();
        queryWrapper5.like("mentality", "压力很大，有快要崩溃的感觉");
        Integer count5 = youthJobInvestigateMapper.selectCount(queryWrapper5);
        String[] workName = {"压力很大，有快要崩溃的感觉", "有点压力，但能自我应对", "有一定压力，感觉有精力透支的情况", "压力较大，对生活或工作上的事情疲于应付", "压力很大，有快要崩溃的感觉"};
        Integer[] workCount = {count1, count2, count3, count4, count5};
        YouthJobInvestigateVo vo = new YouthJobInvestigateVo();
        vo.setWorkName(workName);
        vo.setWorkCount(workCount);
        return Result.success(vo);
    }

    //未就业人员经济压力
    @GetMapping("/getIsLifeStressStat")
    public Result<Object> getIsLifeStressStat() {
        List<YouthJobInvestigateVo> vos = new ArrayList<>();
        QueryWrapper<YouthJobInvestigateModel> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("is_life_stress", "没什么压力");
        Integer count1 = youthJobInvestigateMapper.selectCount(queryWrapper1);
        YouthJobInvestigateVo vo1 = new YouthJobInvestigateVo();
        vo1.setName("没什么压力");
        vo1.setValue(count1);
        vos.add(vo1);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("is_life_stress", "有点压力");
        Integer count2 = youthJobInvestigateMapper.selectCount(queryWrapper2);
        YouthJobInvestigateVo vo2 = new YouthJobInvestigateVo();
        vo2.setName("有点压力");
        vo2.setValue(count2);
        vos.add(vo2);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("is_life_stress", "压力很大");
        Integer count3 = youthJobInvestigateMapper.selectCount(queryWrapper3);
        YouthJobInvestigateVo vo3 = new YouthJobInvestigateVo();
        vo3.setName("压力很大");
        vo3.setValue(count3);
        vos.add(vo3);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.like("is_life_stress", "不好说");
        Integer count4 = youthJobInvestigateMapper.selectCount(queryWrapper4);
        YouthJobInvestigateVo vo4 = new YouthJobInvestigateVo();
        vo4.setName("不好说");
        vo4.setValue(count4);
        vos.add(vo4);
        return Result.success(vos);
    }

    //近三年登记离校未就业高校毕业生
    @GetMapping("/getGraduationTimeStat")
    public Result<Object> getGraduationTimeStat() {
        QueryWrapper<YouthJobInvestigateModel> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("graduation_time", "2023年");
        Integer count1 = youthJobInvestigateMapper.selectCount(queryWrapper1);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("graduation_time", "2022年");
        Integer count2 = youthJobInvestigateMapper.selectCount(queryWrapper2);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("graduation_time", "2021年");
        Integer count3 = youthJobInvestigateMapper.selectCount(queryWrapper3);
        String[] workName = {"2023年", "2022年", "2021年"};
        Integer[] workCount = {count1, count2, count3};
        YouthJobInvestigateVo vo = new YouthJobInvestigateVo();
        vo.setWorkName(workName);
        vo.setWorkCount(workCount);
        return Result.success(vo);
    }

    //毕业时对于求职就业方向的考虑
    @GetMapping("/getWorkIntentionStat")
    public Result<Object> getWorkIntentionStat() {
        List<YouthJobInvestigateVo> vos = new ArrayList<>();
        QueryWrapper<YouthJobInvestigateModel> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("work_intention", "考公考编");
        Integer count1 = youthJobInvestigateMapper.selectCount(queryWrapper1);
        YouthJobInvestigateVo vo1 = new YouthJobInvestigateVo();
        vo1.setName("考公考编");
        vo1.setValue(count1);
        vos.add(vo1);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("work_intention", "升学");
        Integer count2 = youthJobInvestigateMapper.selectCount(queryWrapper2);
        YouthJobInvestigateVo vo2 = new YouthJobInvestigateVo();
        vo2.setName("升学");
        vo2.setValue(count2);
        vos.add(vo2);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("work_intention", "出国");
        Integer count3 = youthJobInvestigateMapper.selectCount(queryWrapper3);
        YouthJobInvestigateVo vo3 = new YouthJobInvestigateVo();
        vo3.setName("出国");
        vo3.setValue(count3);
        vos.add(vo3);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.like("work_intention", "国有企业");
        Integer count4 = youthJobInvestigateMapper.selectCount(queryWrapper4);
        YouthJobInvestigateVo vo4 = new YouthJobInvestigateVo();
        vo4.setName("国有企业");
        vo4.setValue(count4);
        vos.add(vo4);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper5 = new QueryWrapper<>();
        queryWrapper5.like("work_intention", "私企民企");
        Integer count5 = youthJobInvestigateMapper.selectCount(queryWrapper5);
        YouthJobInvestigateVo vo5 = new YouthJobInvestigateVo();
        vo5.setName("私企民企");
        vo5.setValue(count5);
        vos.add(vo5);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper6 = new QueryWrapper<>();
        queryWrapper6.like("work_intention", "外企或合资企业");
        Integer count6 = youthJobInvestigateMapper.selectCount(queryWrapper6);
        YouthJobInvestigateVo vo6 = new YouthJobInvestigateVo();
        vo6.setName("外企或合资企业");
        vo6.setValue(count6);
        vos.add(vo6);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper7 = new QueryWrapper<>();
        queryWrapper7.like("work_intention", "灵活就业或自由职业");
        Integer count7 = youthJobInvestigateMapper.selectCount(queryWrapper7);
        YouthJobInvestigateVo vo7 = new YouthJobInvestigateVo();
        vo7.setName("灵活就业或自由职业");
        vo7.setValue(count7);
        vos.add(vo7);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper8 = new QueryWrapper<>();
        queryWrapper8.like("work_intention", "自主创业");
        Integer count8 = youthJobInvestigateMapper.selectCount(queryWrapper8);
        YouthJobInvestigateVo vo8 = new YouthJobInvestigateVo();
        vo8.setName("自主创业");
        vo8.setValue(count8);
        vos.add(vo8);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper9 = new QueryWrapper<>();
        queryWrapper9.like("work_intention", "参军入伍");
        Integer count9 = youthJobInvestigateMapper.selectCount(queryWrapper9);
        YouthJobInvestigateVo vo9 = new YouthJobInvestigateVo();
        vo9.setName("参军入伍");
        vo9.setValue(count9);
        vos.add(vo9);

        QueryWrapper<YouthJobInvestigateModel> queryWrapper10 = new QueryWrapper<>();
        queryWrapper10.like("work_intention", "其他");
        Integer count10 = youthJobInvestigateMapper.selectCount(queryWrapper10);
        YouthJobInvestigateVo vo10 = new YouthJobInvestigateVo();
        vo10.setName("其他");
        vo10.setValue(count10);
        vos.add(vo10);
        return Result.success(vos);
    }

    /**
     * 用户信息导出word
     *
     * @throws IOException
     */
    @RequestMapping("/exportUserWord")
    public void exportUserWord(HttpServletRequest request, HttpServletResponse response) throws Exception {
        response.setContentType("application/vnd.openxmlformats-officedocument.wordprocessingml.document");
        response.setHeader("Content-Disposition", "attachment;filename=" + new SimpleDateFormat("yyyyMMddHHmm").format(new Date()) + ".docx");
        Map<String, Object> params = new HashMap<>();
        // 渲染文本
        int countZong = youthJobInvestigateService.getCount(null, null);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
        String newTime = sdf.format(CommonHelp.getNowTimestamp());
        params.put("time", newTime);
        params.put("countZong", countZong);
        int countMan = youthJobInvestigateService.getCount("sex", "男");
        params.put("countMan", countMan);//男人数
        params.put("countWoman", countZong - countMan);//女人数
        int townThan = youthJobInvestigateService.getCount("domicile", "城镇");
        params.put("townThan", WordUtil.thanUtil(townThan, countZong));//城镇占比
        params.put("villageThan", WordUtil.thanUtil((countZong - townThan), countZong));//农村占比
        int middleThan = youthJobInvestigateService.getCount("education", "初中");
        params.put("middleThan", WordUtil.thanUtil(middleThan, countZong));//初中占比
        int educationCount1 = youthJobInvestigateService.getCount("education", "高中");
        int educationCount2 = youthJobInvestigateService.getCount("education", "中专");
        int educationCount3 = youthJobInvestigateService.getCount("education", "技师学院");
        params.put("highThan", WordUtil.thanUtil((educationCount1 + educationCount2 + educationCount3), countZong));//高中占比
        int highDutyThan = youthJobInvestigateService.getCount("education", "高职");
        params.put("highDutyThan", WordUtil.thanUtil(highDutyThan, countZong));//高职占比
        int bigThan = youthJobInvestigateService.getCount("education", "本科");
        int bigThan2 = youthJobInvestigateService.getCount("education", "研究生");
        params.put("bigThan", WordUtil.thanUtil((bigThan + bigThan2), countZong));//本科占比
        int notWork = youthJobInvestigateService.getCount("graduation_time", "2024");
        int notWork2 = youthJobInvestigateService.getCount("graduation_time", "2025");

        int notWork3 = youthJobInvestigateService.getCount("recent_work_situation", "没有上述情形");
        int workCount = countZong - notWork3;
        params.put("notWorkCount", notWork3);//无工作人数
        params.put("notWorkThan", WordUtil.thanUtil(notWork3, countZong));//无工作占比
        params.put("workCount", workCount);//有工作人数
        params.put("workThan", WordUtil.thanUtil(workCount, countZong));//有工作占比
        int unitThan = youthJobInvestigateService.geModelCount("work_identity", "单位雇员");

        params.put("unitThan", WordUtil.thanUtil(unitThan, workCount));//单位工作占比
        int ownThan = youthJobInvestigateService.geModelCount("work_identity", "自主经营或雇主");
        params.put("ownThan", WordUtil.thanUtil(ownThan, workCount));//自主经营或雇主占比
        int flexibleThan = youthJobInvestigateService.geModelCount("work_identity", "灵活就业或自由职业");
        params.put("flexibleThan", WordUtil.thanUtil(flexibleThan, workCount));//灵活就业或自由职业占比
        int perfectThan = youthJobInvestigateService.getCount("this_work_satisfied", "非常满意");
        params.put("perfectThan", WordUtil.thanUtil(perfectThan, workCount));//非常满意占比
        int generalThan = youthJobInvestigateService.getCount("this_work_satisfied", "一般");
        params.put("generalThan", WordUtil.thanUtil(generalThan, workCount));//一般占比
        int unsatisfactoryThan = youthJobInvestigateService.getCount("this_work_satisfied", "非常不满意");
        int unsatisfactoryThan2 = youthJobInvestigateService.getCount("this_work_satisfied", "比较不满意");
        params.put("unsatisfactoryThan", WordUtil.thanUtil(unsatisfactoryThan + unsatisfactoryThan2, workCount));//非常满意占比
        int sumWages = youthJobInvestigateService.getWagesSum();
        int result = sumWages / workCount;
        int avgWages = youthJobInvestigateService.getWorkAvg();
        params.put("avgWages", avgWages);//平均工资
        int workTime = youthJobInvestigateService.getWorkTimeSum();
        int avgWorkTime = workTime / workCount;
        double aveTime = avgWorkTime / 7;
        BigDecimal bd = new BigDecimal(aveTime);
        double sunAgeTime = bd.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
        params.put("sunAgeTime", sunAgeTime);//平均工作时长
        int notChangeWork = youthJobInvestigateService.getCount("work_count", "一直没换过");
        params.put("notChangeWork", WordUtil.thanUtil(notChangeWork, workCount));//没换过工作
        int noeWork = youthJobInvestigateService.getCount("work_count", "1");
        params.put("noeWork", WordUtil.thanUtil(noeWork, workCount));//1次
        int twoWork = youthJobInvestigateService.getCount("work_count", "2");
        params.put("twoWork", WordUtil.thanUtil(twoWork, workCount));//2次
        int threeWork = youthJobInvestigateService.getCount("work_count", "3");
        params.put("threeWork", WordUtil.thanUtil(threeWork, workCount));//3次
        int readyReplaceCount = youthJobInvestigateService.getCount("half_year_change_work", "是");
        params.put("readyReplaceCount", readyReplaceCount);
        params.put("readyReplaceThan", WordUtil.thanUtil(readyReplaceCount, workCount));
        int lackMoneyThan = youthJobInvestigateService.getCount("change_work_reason", "薪酬不满意");
        params.put("lackMoneyThan", WordUtil.thanUtil(lackMoneyThan, workCount));
        int instabilityThan = youthJobInvestigateService.getCount("change_work_reason", "工作稳定性不够");
        params.put("instabilityThan", WordUtil.thanUtil(instabilityThan, workCount));
        int notPromotionThan = youthJobInvestigateService.getCount("change_work_reason", "晋升空间小");
        params.put("notPromotionThan", WordUtil.thanUtil(notPromotionThan, workCount));
        int threeGetWork = youthJobInvestigateService.getCount("three_mm_for_work", "是");
        params.put("threeGetWork", threeGetWork);
        params.put("noWorkThan", WordUtil.thanUtil(notWork3, countZong));
        int isConfidenceGetWork = youthJobInvestigateService.getCount("is_confidence_get_work", "有");
        params.put("yesConfidenceGetWork", WordUtil.thanUtil(isConfidenceGetWork, notWork3));
        int noConfidenceGetWork = youthJobInvestigateService.getCount("is_confidence_get_work", "没");
        params.put("noConfidenceGetWork", WordUtil.thanUtil(noConfidenceGetWork, notWork3));
        int noeConfidenceGetWork = youthJobInvestigateService.getCount("is_confidence_get_work", "一般");
        params.put("noeConfidenceGetWork", WordUtil.thanUtil(noeConfidenceGetWork, notWork3));
        int recessionThan = youthJobInvestigateService.getCount("get_work_difficulty", "经济不景气");
        params.put("recessionThan", WordUtil.thanUtil(recessionThan, notWork3));
        int notsatisfiedThan = youthJobInvestigateService.getCount("get_work_difficulty", "但满足自己要求的少");
        params.put("notsatisfiedThan", WordUtil.thanUtil(notsatisfiedThan, notWork3));
        int notFieldThan = youthJobInvestigateService.getCount("get_work_difficulty", "专业不对口");
        params.put("notFieldThan", WordUtil.thanUtil(notFieldThan, notWork3));
        int notSkillThan = youthJobInvestigateService.getCount("get_work_difficulty", "求职方法与求职技巧掌握不够");
        params.put("notSkillThan", WordUtil.thanUtil(notSkillThan, notWork3));
        int notEducationThan = youthJobInvestigateService.getCount("get_work_difficulty", "学历");
        params.put("notEducationThan", WordUtil.thanUtil(notEducationThan, notWork3));

        int provisionalThan = youthJobInvestigateService.getCount("for_work_cheat_select", "先就业再择业");
        params.put("provisionalThan", WordUtil.thanUtil(provisionalThan, notWork3));
        int oddJobThan = youthJobInvestigateService.getCount("for_work_cheat_select", "从事灵活就业");
        params.put("oddJobThan", WordUtil.thanUtil(oddJobThan, notWork3));
        int noMoreWorkThan = youthJobInvestigateService.getCount("for_work_cheat_select", "暂不就业");
        params.put("noMoreWorkThan", WordUtil.thanUtil(noMoreWorkThan, notWork3));
        int notPressureThan = youthJobInvestigateService.getNotWorkThan("mentality", "没有压力");
        params.put("notPressureThan", WordUtil.thanUtil(notPressureThan, notWork3));
        int twoPressureThan = youthJobInvestigateService.getNotWorkThan("mentality", "有点压力");
        params.put("twoPressureThan", WordUtil.thanUtil(twoPressureThan, notWork3));
        int bigPressureThan = youthJobInvestigateService.getNotWorkThan("mentality", "大");
        params.put("bigPressureThan", WordUtil.thanUtil(bigPressureThan, notWork3));

        int normalThan = youthJobInvestigateService.getCount("not_smoothly_solve", "觉得正常");
        params.put("normalThan", WordUtil.thanUtil(normalThan, countZong));
        int dropThan = youthJobInvestigateService.getCount("not_smoothly_solve", "落差");
        params.put("dropThan", WordUtil.thanUtil(dropThan, countZong));
        int loseThan = youthJobInvestigateService.getCount("not_smoothly_solve", "失落");
        int loseThan2 = youthJobInvestigateService.getCount("not_smoothly_solve", "怀才不遇");
        int loseThan3 = youthJobInvestigateService.getCount("not_smoothly_solve", "有挫败感");
        int loseThan4 = youthJobInvestigateService.getCount("not_smoothly_solve", "烦躁不安");
        int loseThan5 = youthJobInvestigateService.getCount("not_smoothly_solve", "抱怨");
        int loseThan6 = youthJobInvestigateService.getCount("not_smoothly_solve", "失望和不满");
        params.put("loseThan", WordUtil.thanUtil((loseThan + loseThan2 + loseThan3 + loseThan4 + loseThan5 + loseThan6), countZong));
        int yesEconomyCount = youthJobInvestigateService.getNotWorkThan("is_life_stress", "没什么压力");
        int notEconomyCount = youthJobInvestigateService.getNotWorkThan("is_life_stress", "有点压力");
        int poorCount = youthJobInvestigateService.getNotWorkThan("is_life_stress", "压力很大");
        params.put("yesEconomyCount", yesEconomyCount);
        params.put("notEconomyCount", notEconomyCount);
        params.put("poorCount", poorCount);
        params.put("yesEconomyThan", WordUtil.thanUtil(yesEconomyCount, notWork3));
        params.put("notEconomyThan", WordUtil.thanUtil(notEconomyCount, notWork3));
        params.put("poorThan", WordUtil.thanUtil(poorCount, notWork3));
        int notGraduate = notWork + notWork2;
        params.put("notGraduate", notGraduate);
        int upgradationThan = youthJobInvestigateService.getCount("work_intention_other", "升学");
        params.put("upgradationThan", WordUtil.thanUtil(poorCount, notGraduate));
        int organizationThan = youthJobInvestigateService.getCount("work_intention_other", "考公考编");
        params.put("organizationThan", WordUtil.thanUtil(organizationThan, notGraduate));
        int stateOwnedThan = youthJobInvestigateService.getCount("work_intention_other", "国有企业");
        params.put("stateOwnedThan", WordUtil.thanUtil(stateOwnedThan, notGraduate));
        int oddJobThan2 = youthJobInvestigateService.getCount("work_intention_other", "灵活就业或自由职业");
        params.put("oddJobThan2", WordUtil.thanUtil(oddJobThan2, notGraduate));
        int privateEnterpriseThan = youthJobInvestigateService.getCount("work_intention_other", "私企民企");
        params.put("privateEnterpriseThan", WordUtil.thanUtil(privateEnterpriseThan, notGraduate));
        int entrepreneurshipThan = youthJobInvestigateService.getCount("work_intention_other", "自主创业");
        params.put("entrepreneurshipThan", WordUtil.thanUtil(entrepreneurshipThan, notGraduate));

//        // 渲染图片
//        params.put("picture", new PictureRenderData(120, 120, "D:\\cssTest\\square.png"));
        // TODO 渲染其他类型的数据请参考官方文档
        String templatePath = "C:\\upload\\稳就业专报.docx";
        Long time = new Date().getTime();
        // 生成的word格式
        String formatSuffix = ".docx";
        // 拼接后的文件名
        String fileName = time + formatSuffix;

        //设置生成的文件存放路径，可以存放在你想要指定的路径里面
        String rootPath = "C:/upload/" + File.separator + "file/word/";
        String filePath = rootPath + fileName;
        File newFile = new File(filePath);
        //判断目标文件所在目录是否存在
        if (!newFile.getParentFile().exists()) {
            //如果目标文件所在的目录不存在，则创建父目录
            newFile.getParentFile().mkdirs();
        }
        // 读取模板templatePath并将paramMap的内容填充进模板，即编辑模板(compile)+渲染数据(render)
        XWPFTemplate template = XWPFTemplate.compile(templatePath).render(params);
        replaceAll(template.getXWPFDocument());
        try {
            //out = new FileOutputStream(filePath);//输出路径(下载到指定路径)
            // 将填充之后的模板写入filePath
            template.write(response.getOutputStream());//将template写到OutputStream中
            response.getOutputStream().flush();
            response.getOutputStream().close();
            template.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 用户信息导出excel
     *
     * @throws IOException
     */
    @RequestMapping("/exportUserExcel")
    public void exportUserExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
        Map<String, Object> params = new HashMap<>();
        // 渲染文本
        int countZong = youthJobInvestigateService.getCount(null, null);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
        String newTime = sdf.format(CommonHelp.getNowTimestamp());
        params.put("time", newTime);
        params.put("countZong", countZong);
        int countMan = youthJobInvestigateService.getCount("sex", "男");
        params.put("countMan", countMan);//男人数
        params.put("countWoman", countZong - countMan);//女人数
        int townThan = youthJobInvestigateService.getCount("domicile", "城镇");
        params.put("townCount", townThan);//城镇占比
        params.put("villageCount", countZong - townThan);//农村占比
        int middleCount = youthJobInvestigateService.getCount("education", "初中");
        params.put("middleCount", middleCount);//初中占比
        int educationCount1 = youthJobInvestigateService.getCount("education", "高中");
        int educationCount2 = youthJobInvestigateService.getCount("education", "中专");
        int educationCount3 = youthJobInvestigateService.getCount("education", "技师学院");
        int highDutyThan = youthJobInvestigateService.getCount("education", "高职");
        int bigThan = youthJobInvestigateService.getCount("education", "本科");
        int bigThan2 = youthJobInvestigateService.getCount("education", "研究生");
        params.put("educationCount1", educationCount1);
        params.put("educationCount2", educationCount2);
        params.put("educationCount3", educationCount3);
        params.put("highDutyThan", highDutyThan);
        params.put("bigThan", bigThan);
        params.put("bigThan2", bigThan2);
        int notWork = youthJobInvestigateService.getCount("graduation_time", "2024");
        int notWork2 = youthJobInvestigateService.getCount("graduation_time", "2025");

        int notWork3 = youthJobInvestigateService.getCount("recent_work_situation", "没有上述情形");
        int workCount = countZong - notWork3;
        params.put("notWorkCount", notWork3);//无工作人数
        params.put("workCount", workCount);//有工作人数
        int unitCount = youthJobInvestigateService.geModelCount("work_identity", "单位雇员");
        params.put("unitCount", unitCount);//单位工作人数
        int ownCount = youthJobInvestigateService.geModelCount("work_identity", "自主经营或雇主");
        params.put("ownCount", ownCount);//自主经营或雇主
        int flexibleCount = youthJobInvestigateService.geModelCount("work_identity", "灵活就业或自由职业");
        params.put("flexibleCount", flexibleCount);//灵活就业或自由职业
        int perfectCount = youthJobInvestigateService.getCount("this_work_satisfied", "非常满意");
        params.put("perfectCount", perfectCount);//非常满意
        int generalCount = youthJobInvestigateService.getCount("this_work_satisfied", "一般");
        params.put("generalCount", generalCount);//一般
        int unsatisfactoryCount = youthJobInvestigateService.getCount("this_work_satisfied", "非常不满意");
        int unsatisfactoryThan2 = youthJobInvestigateService.getCount("this_work_satisfied", "比较不满意");
        params.put("unsatisfactoryCount", unsatisfactoryCount);//非常不满意
        params.put("unsatisfactoryThan2", unsatisfactoryThan2);//比较不满意
        int sumWages = youthJobInvestigateService.getWagesSum();
        int avgWages = youthJobInvestigateService.getWorkAvg();
        params.put("avgWages", avgWages);//平均工资
        int workTime = youthJobInvestigateService.getWorkTimeSum();
        int avgWorkTime = workTime / workCount;
        double aveTime = avgWorkTime / 7;
        BigDecimal bd = new BigDecimal(aveTime);
        double sunAgeTime = bd.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
        params.put("sunAgeTime", sunAgeTime);//平均工作时长
        int notChangeWork = youthJobInvestigateService.getCount("work_count", "一直没换过");
        params.put("notChangeWork", notChangeWork);//没换过工作
        int noeWork = youthJobInvestigateService.getCount("work_count", "1");
        params.put("noeWork", noeWork);//1次
        int twoWork = youthJobInvestigateService.getCount("work_count", "2");
        params.put("twoWork", twoWork);//2次
        int threeWork = youthJobInvestigateService.getCount("work_count", "3");
        params.put("threeWork", threeWork);//3次
        int readyReplaceCount = youthJobInvestigateService.getCount("half_year_change_work", "是");
        params.put("readyReplaceCount", readyReplaceCount);
        int lackMoneyCount = youthJobInvestigateService.getCount("change_work_reason", "薪酬不满意");
        params.put("lackMoneyCount", lackMoneyCount);
        int instabilityCount = youthJobInvestigateService.getCount("change_work_reason", "工作稳定性不够");
        params.put("instabilityCount", instabilityCount);
        int notPromotionCount = youthJobInvestigateService.getCount("change_work_reason", "晋升空间小");
        params.put("notPromotionCount", notPromotionCount);
        int threeGetWork = youthJobInvestigateService.getCount("three_mm_for_work", "是");
        params.put("threeGetWork", threeGetWork);
        params.put("noWorkThan", WordUtil.thanUtil(notWork3, countZong));
        int isConfidenceGetWork = youthJobInvestigateService.getCount("is_confidence_get_work", "有");
        params.put("yesConfidenceGetWork", isConfidenceGetWork);
        int noConfidenceGetWork = youthJobInvestigateService.getCount("is_confidence_get_work", "没");
        params.put("noConfidenceGetWork", noConfidenceGetWork);
        int noeConfidenceGetWork = youthJobInvestigateService.getCount("is_confidence_get_work", "一般");
        params.put("noeConfidenceGetWork", noeConfidenceGetWork);
        int recessionCount = youthJobInvestigateService.getCount("get_work_difficulty", "经济不景气");
        params.put("recessionCount", recessionCount);
        int notsatisfiedCount = youthJobInvestigateService.getCount("get_work_difficulty", "但满足自己要求的少");
        params.put("notsatisfiedCount", notsatisfiedCount);
        int notFieldCount = youthJobInvestigateService.getCount("get_work_difficulty", "专业不对口");
        params.put("notFieldCount", notFieldCount);
        int notSkillThan = youthJobInvestigateService.getCount("get_work_difficulty", "求职方法与求职技巧掌握不够");
        params.put("notSkillThan", WordUtil.thanUtil(notSkillThan, notWork3));
        int notEducationCount = youthJobInvestigateService.getCount("get_work_difficulty", "学历");
        params.put("notEducationCount", notEducationCount);
        int provisionalCount = youthJobInvestigateService.getCount("for_work_cheat_select", "先就业再择业");
        params.put("provisionalCount", provisionalCount);
        int oddJobCount = youthJobInvestigateService.getCount("for_work_cheat_select", "从事灵活就业");
        params.put("oddJobCount", oddJobCount);
        int noMoreWorkCount = youthJobInvestigateService.getCount("for_work_cheat_select", "暂不就业");
        params.put("noMoreWorkCount", noMoreWorkCount);
        int notPressureCount = youthJobInvestigateService.getNotWorkThan("mentality", "没有压力");
        params.put("notPressureCount", notPressureCount);
        int twoPressureCount = youthJobInvestigateService.getNotWorkThan("mentality", "有点压力");
        params.put("twoPressureCount", twoPressureCount);
        int bigPressureCount = youthJobInvestigateService.getNotWorkThan("mentality", "大");
        params.put("bigPressureCount", bigPressureCount);

        int normalCount = youthJobInvestigateService.getCount("not_smoothly_solve", "觉得正常");
        params.put("normalCount", normalCount);
        int dropCount = youthJobInvestigateService.getCount("not_smoothly_solve", "落差");
        params.put("dropCount", dropCount);
        int loseThan = youthJobInvestigateService.getCount("not_smoothly_solve", "失落");
        int loseThan2 = youthJobInvestigateService.getCount("not_smoothly_solve", "怀才不遇");
        int loseThan3 = youthJobInvestigateService.getCount("not_smoothly_solve", "有挫败感");
        int loseThan4 = youthJobInvestigateService.getCount("not_smoothly_solve", "烦躁不安");
        int loseThan5 = youthJobInvestigateService.getCount("not_smoothly_solve", "抱怨");
        int loseThan6 = youthJobInvestigateService.getCount("not_smoothly_solve", "失望和不满");
        params.put("loseThan", loseThan);
        params.put("loseThan2", loseThan2);
        params.put("loseThan3", loseThan3);
        params.put("loseThan4", loseThan4);
        params.put("loseThan5", loseThan5);
        params.put("loseThan6", loseThan6);
        int yesEconomyCount = youthJobInvestigateService.getNotWorkThan("is_life_stress", "没什么压力");
        int notEconomyCount = youthJobInvestigateService.getNotWorkThan("is_life_stress", "有点压力");
        int poorCount = youthJobInvestigateService.getNotWorkThan("is_life_stress", "压力很大");
        params.put("yesEconomyCount", yesEconomyCount);
        params.put("notEconomyCount", notEconomyCount);
        params.put("poorCount", poorCount);
        int notGraduate = notWork + notWork2;
        params.put("notGraduate", notGraduate);
        int upgradationThan = youthJobInvestigateService.getCount("work_intention_other", "升学");
        params.put("upgradationThan", WordUtil.thanUtil(poorCount, notGraduate));
        int organizationThan = youthJobInvestigateService.getCount("work_intention_other", "考公考编");
        params.put("organizationThan", WordUtil.thanUtil(organizationThan, notGraduate));
        int stateOwnedThan = youthJobInvestigateService.getCount("work_intention_other", "国有企业");
        params.put("stateOwnedThan", WordUtil.thanUtil(stateOwnedThan, notGraduate));
        int oddJobThan2 = youthJobInvestigateService.getCount("work_intention_other", "灵活就业或自由职业");
        params.put("oddJobThan2", WordUtil.thanUtil(oddJobThan2, notGraduate));
        int privateEnterpriseThan = youthJobInvestigateService.getCount("work_intention_other", "私企民企");
        params.put("privateEnterpriseThan", WordUtil.thanUtil(privateEnterpriseThan, notGraduate));
        int entrepreneurshipThan = youthJobInvestigateService.getCount("work_intention_other", "自主创业");
        params.put("entrepreneurshipThan", WordUtil.thanUtil(entrepreneurshipThan, notGraduate));


        ClassPathResource classPathResource = new ClassPathResource("C:/upload/investigate_tables.xlsx");
        String path = classPathResource.getPath();
        TemplateExportParams templateExportParams1 = new TemplateExportParams(path);
        Workbook wb = ExcelExportUtil.exportExcel(templateExportParams1, params);
        String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy_MM_dd_HH_mm_ss"));
        String fileName = "问卷调查统计表" + time + ".xlsx";
        try {
            response.setContentType("application/vnd.ms-excel");
            response.setHeader("Content-disposition", "attachment;filename=" + fileName);
            response.flushBuffer();
            wb.write(response.getOutputStream());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    /**
     * @Description: 替换段落和表格和图表等内容
     */
    public void replaceAll(XWPFDocument doc) throws Exception {
        doCharts(doc);  // 处理图表数据，柱状图
    }


    /**
     * 处理图表
     *
     * @param doc
     * @throws FileNotFoundException
     */
    public void doCharts(XWPFDocument doc) throws FileNotFoundException {
        /**----------------------------处理图表------------------------------------**/
        // 获取word模板中的所有图表元素，用map存放
        // 为什么不用list保存：查看doc.getRelations()的源码可知，源码中使用了hashMap读取文档图表元素，
        // 对relations变量进行打印后发现，图表顺序和文档中的顺序不一致，也就是说relations的图表顺序不是文档中从上到下的顺序
        Map<String, POIXMLDocumentPart> chartsMap = new HashMap<String, POIXMLDocumentPart>();
        //动态刷新图表
        List<POIXMLDocumentPart> relations = doc.getRelations();
        for (POIXMLDocumentPart poixmlDocumentPart : relations) {
            if (poixmlDocumentPart instanceof XWPFChart) {  // 如果是图表元素

                // 获取图表对应的表格数据里面的第一行第一列数据，可以拿来当作key值
                String key = new PoiWordTools().getZeroData(poixmlDocumentPart).trim();

                System.out.println("key：" + key);

                chartsMap.put(key, poixmlDocumentPart);
            }
        }

        System.out.println("\n图表数量：" + chartsMap.size() + "\n");

        // 第一个图表-饼状图
        doCharts1(chartsMap);
        // 第二个图表-柱状图
        doCharts2(chartsMap);
        //第三个图表-饼状图
        doCharts3(chartsMap);
        // 第四个图表-柱状图
        doCharts4(chartsMap);
        // 第五个图表-柱状图
        doCharts5(chartsMap);
        // 第六个图表-柱状图
        doCharts6(chartsMap);

        doCharts7(chartsMap);

        doCharts8(chartsMap);

    }


    public void doCharts1(Map<String, POIXMLDocumentPart> chartsMap) {
        // 数据准备
        List<String> titleArr = new ArrayList<String>();// 标题
        titleArr.add("");
        titleArr.add("就业满意度");

        List<String> fldNameArr = new ArrayList<String>();// 字段名(数据有多少列，就多少个)
        fldNameArr.add("item1");
        fldNameArr.add("item2");
        // 数据集合
        List<Map<String, String>> listItemsByType = new ArrayList<Map<String, String>>();
        QueryWrapper<YouthJobInvestigateModel> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("this_work_satisfied", "非常满意");
        Integer count1 = youthJobInvestigateMapper.selectCount(queryWrapper1);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("this_work_satisfied", "比较满意");
        Integer count2 = youthJobInvestigateMapper.selectCount(queryWrapper2);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("this_work_satisfied", "一般");
        Integer count3 = youthJobInvestigateMapper.selectCount(queryWrapper3);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.like("this_work_satisfied", "比较不满意");
        Integer count4 = youthJobInvestigateMapper.selectCount(queryWrapper4);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper5 = new QueryWrapper<>();
        queryWrapper5.like("this_work_satisfied", "非常不满意");
        Integer count5 = youthJobInvestigateMapper.selectCount(queryWrapper5);

        // 第一行数据
        Map<String, String> base1 = new HashMap<String, String>();
        base1.put("item1", "非常满意");
        base1.put("item2", (int) count1 + "");


        // 第二行数据
        Map<String, String> base2 = new HashMap<String, String>();
        base2.put("item1", "比较满意");
        base2.put("item2", (int) count2 + "");


        // 第三行数据
        Map<String, String> base3 = new HashMap<String, String>();
        base3.put("item1", "一般");
        base3.put("item2", (int) count3 + "");

        // 第三行数据
        Map<String, String> base4 = new HashMap<String, String>();
        base4.put("item1", "比较不满意");
        base4.put("item2", (int) count4 + "");

        // 第三行数据
        Map<String, String> base5 = new HashMap<String, String>();
        base5.put("item1", "非常不满意");
        base5.put("item2", (int) count5 + "");
        listItemsByType.add(base1);
        listItemsByType.add(base2);
        listItemsByType.add(base3);
        listItemsByType.add(base4);
        listItemsByType.add(base5);
        // 注意这里的key值
        POIXMLDocumentPart poixmlDocumentPart = chartsMap.get("就业满意度");
        new PoiWordTools().replacePieCharts(poixmlDocumentPart, titleArr, fldNameArr, listItemsByType);
    }

    public void doCharts2(Map<String, POIXMLDocumentPart> chartsMap) {
        // 数据准备
        List<String> titleArr = new ArrayList<String>();// 标题
        titleArr.add("");
        titleArr.add("人数");

        List<String> fldNameArr = new ArrayList<String>();// 字段名(数据有多少列，就多少个)
        fldNameArr.add("item1");
        fldNameArr.add("item2");
        // 数据集合
        List<Map<String, String>> listItemsByType = new ArrayList<Map<String, String>>();

        // 数据的话随便整都行

        QueryWrapper<YouthJobInvestigateModel> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("work_count", "一直没换过");
        Integer count1 = youthJobInvestigateMapper.selectCount(queryWrapper1);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("work_count", "换过1次");
        Integer count2 = youthJobInvestigateMapper.selectCount(queryWrapper2);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("work_count", "换过2次");
        Integer count3 = youthJobInvestigateMapper.selectCount(queryWrapper3);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.like("work_count", "换过3次");
        Integer count4 = youthJobInvestigateMapper.selectCount(queryWrapper4);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper5 = new QueryWrapper<>();
        queryWrapper5.like("work_count", "换过3次以上");
        Integer count5 = youthJobInvestigateMapper.selectCount(queryWrapper5);
        // 第一行数据
        Map<String, String> base1 = new HashMap<String, String>();
        base1.put("item1", "一直没换过");
        base1.put("item2", String.valueOf(count1));


        // 第二行数据
        Map<String, String> base2 = new HashMap<String, String>();
        base2.put("item1", "换过1次");
        base2.put("item2", String.valueOf(count2));


        // 第三行数据
        Map<String, String> base3 = new HashMap<String, String>();
        base3.put("item1", "换过2次");
        base3.put("item2", String.valueOf(count3));

        Map<String, String> base4 = new HashMap<String, String>();
        base4.put("item1", "换过3次");
        base4.put("item2", String.valueOf(count4));


        Map<String, String> base5 = new HashMap<String, String>();
        base5.put("item1", "换过3次以上");
        base5.put("item2", String.valueOf(count5));

        listItemsByType.add(base1);
        listItemsByType.add(base2);
        listItemsByType.add(base3);
        listItemsByType.add(base4);
        listItemsByType.add(base5);

        // 注意这里的key值
        POIXMLDocumentPart poixmlDocumentPart = chartsMap.get("更换工作的次数");
        new PoiWordTools().replaceBarCharts(poixmlDocumentPart, titleArr, fldNameArr, listItemsByType);
    }

    public void doCharts3(Map<String, POIXMLDocumentPart> chartsMap) {
        // 数据准备
        List<String> titleArr = new ArrayList<String>();// 标题
        titleArr.add("");
        titleArr.add("失业人员求职信心");

        List<String> fldNameArr = new ArrayList<String>();// 字段名(数据有多少列，就多少个)
        fldNameArr.add("item1");
        fldNameArr.add("item2");

        // 数据集合
        List<Map<String, String>> listItemsByType = new ArrayList<Map<String, String>>();

        QueryWrapper<YouthJobInvestigateModel> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("is_confidence_get_work", "非常有信心");
        Integer count1 = youthJobInvestigateMapper.selectCount(queryWrapper1);


        QueryWrapper<YouthJobInvestigateModel> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("is_confidence_get_work", "比较有信心");
        Integer count2 = youthJobInvestigateMapper.selectCount(queryWrapper2);


        QueryWrapper<YouthJobInvestigateModel> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("is_confidence_get_work", "一般");
        Integer count3 = youthJobInvestigateMapper.selectCount(queryWrapper3);


        QueryWrapper<YouthJobInvestigateModel> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.like("is_confidence_get_work", "比较没信心");
        Integer count4 = youthJobInvestigateMapper.selectCount(queryWrapper4);


        QueryWrapper<YouthJobInvestigateModel> queryWrapper5 = new QueryWrapper<>();
        queryWrapper5.like("is_confidence_get_work", "非常没信心");
        Integer count5 = youthJobInvestigateMapper.selectCount(queryWrapper5);

        // 第一行数据
        Map<String, String> base1 = new HashMap<String, String>();
        base1.put("item1", "非常有信心");
        base1.put("item2", (int) count1 + "");


        // 第二行数据
        Map<String, String> base2 = new HashMap<String, String>();
        base2.put("item1", "比较有信心");
        base2.put("item2", (int) count2 + "");


        // 第三行数据
        Map<String, String> base3 = new HashMap<String, String>();
        base3.put("item1", "一般");
        base3.put("item2", (int) count3 + "");

        // 第三行数据
        Map<String, String> base4 = new HashMap<String, String>();
        base4.put("item1", "比较没信心");
        base4.put("item2", (int) count4 + "");

        // 第三行数据
        Map<String, String> base5 = new HashMap<String, String>();
        base5.put("item1", "非常没信心");
        base5.put("item2", (int) count5 + "");
        listItemsByType.add(base1);
        listItemsByType.add(base2);
        listItemsByType.add(base3);
        listItemsByType.add(base4);
        listItemsByType.add(base5);
        // 注意这里的key值
        POIXMLDocumentPart poixmlDocumentPart = chartsMap.get("失业人员求职信心");
        new PoiWordTools().replacePieCharts(poixmlDocumentPart, titleArr, fldNameArr, listItemsByType);
    }


    public void doCharts5(Map<String, POIXMLDocumentPart> chartsMap) {
        // 数据准备
        List<String> titleArr = new ArrayList<String>();// 标题
        titleArr.add("");
        titleArr.add("人数");

        List<String> fldNameArr = new ArrayList<String>();// 字段名(数据有多少列，就多少个)
        fldNameArr.add("item1");
        fldNameArr.add("item2");
        // 数据集合
        List<Map<String, String>> listItemsByType = new ArrayList<Map<String, String>>();

        // 数据的话随便整都行
        QueryWrapper<YouthJobInvestigateModel> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("mentality", "精神饱满，没有压力，能游刃有余处理各类事情");
        Integer count1 = youthJobInvestigateMapper.selectCount(queryWrapper1);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("mentality", "有点压力，但能自我应对");
        Integer count2 = youthJobInvestigateMapper.selectCount(queryWrapper2);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("mentality", "有一定压力，感觉有精力透支的情况");
        Integer count3 = youthJobInvestigateMapper.selectCount(queryWrapper3);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.like("mentality", "压力较大，对生活或工作上的事情疲于应付");
        Integer count4 = youthJobInvestigateMapper.selectCount(queryWrapper4);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper5 = new QueryWrapper<>();
        queryWrapper5.like("mentality", "压力很大，有快要崩溃的感觉");
        Integer count5 = youthJobInvestigateMapper.selectCount(queryWrapper5);
        // 第一行数据
        Map<String, String> base1 = new HashMap<String, String>();
        base1.put("item1", "精神饱满，没有压力，能游刃有余处理各类事情");
        base1.put("item2", String.valueOf(count1));


        // 第二行数据
        Map<String, String> base2 = new HashMap<String, String>();
        base2.put("item1", "有点压力，但能自我应对");
        base2.put("item2", String.valueOf(count2));


        // 第三行数据
        Map<String, String> base3 = new HashMap<String, String>();
        base3.put("item1", "有一定压力，感觉有精力透支的情况");
        base3.put("item2", String.valueOf(count3));

        Map<String, String> base4 = new HashMap<String, String>();
        base4.put("item1", "压力较大，对生活或工作上的事情疲于应付");
        base4.put("item2", String.valueOf(count4));

        Map<String, String> base5 = new HashMap<String, String>();
        base5.put("item1", "压力很大，有快要崩溃的感觉");
        base5.put("item2", String.valueOf(count5));

        listItemsByType.add(base1);
        listItemsByType.add(base2);
        listItemsByType.add(base3);
        listItemsByType.add(base4);
        listItemsByType.add(base5);

        // 注意这里的key值
        POIXMLDocumentPart poixmlDocumentPart = chartsMap.get("未就业人员精神状态");
        new PoiWordTools().replaceBarCharts(poixmlDocumentPart, titleArr, fldNameArr, listItemsByType);
    }

    public void doCharts4(Map<String, POIXMLDocumentPart> chartsMap) {
        // 数据准备
        List<String> titleArr = new ArrayList<String>();// 标题
        titleArr.add("");
        titleArr.add("人数");

        List<String> fldNameArr = new ArrayList<String>();// 字段名(数据有多少列，就多少个)
        fldNameArr.add("item1");
        fldNameArr.add("item2");
        // 数据集合
        List<Map<String, String>> listItemsByType = new ArrayList<Map<String, String>>();

        // 数据的话随便整都行

        QueryWrapper<YouthJobInvestigateModel> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("get_work_difficulty", "经济不景气， 岗位需求少");
        Integer count1 = youthJobInvestigateMapper.selectCount(queryWrapper1);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("get_work_difficulty", "有岗位需求，但满足自己要求的少");
        Integer count2 = youthJobInvestigateMapper.selectCount(queryWrapper2);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("get_work_difficulty", "不知道怎样获得就业信息");
        Integer count3 = youthJobInvestigateMapper.selectCount(queryWrapper3);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.like("get_work_difficulty", "学历、年龄、性别方面收到区别对待");
        Integer count4 = youthJobInvestigateMapper.selectCount(queryWrapper4);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper5 = new QueryWrapper<>();
        queryWrapper5.like("get_work_difficulty", "不了解企业用人标准");
        Integer count5 = youthJobInvestigateMapper.selectCount(queryWrapper5);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper6 = new QueryWrapper<>();
        queryWrapper6.like("get_work_difficulty", "专业知识、能力水平欠缺");
        Integer count6 = youthJobInvestigateMapper.selectCount(queryWrapper6);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper7 = new QueryWrapper<>();
        queryWrapper7.like("get_work_difficulty", "求职方法与求职技巧掌握不够");
        Integer count7 = youthJobInvestigateMapper.selectCount(queryWrapper7);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper8 = new QueryWrapper<>();
        queryWrapper8.like("get_work_difficulty", "专业不对口");
        Integer count8 = youthJobInvestigateMapper.selectCount(queryWrapper8);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper9 = new QueryWrapper<>();
        queryWrapper9.like("get_work_difficulty", "其他");
        Integer count9 = youthJobInvestigateMapper.selectCount(queryWrapper9);
        // 第一行数据
        Map<String, String> base1 = new HashMap<String, String>();
        base1.put("item1", "经济不景气， 岗位需求少");
        base1.put("item2", String.valueOf(count1));


        // 第二行数据
        Map<String, String> base2 = new HashMap<String, String>();
        base2.put("item1", "有岗位需求，但满足自己要求的少");
        base2.put("item2", String.valueOf(count2));


        // 第三行数据
        Map<String, String> base3 = new HashMap<String, String>();
        base3.put("item1", "不知道怎样获得就业信息");
        base3.put("item2", String.valueOf(count3));

        Map<String, String> base4 = new HashMap<String, String>();
        base4.put("item1", "学历、年龄、性别方面收到区别对待");
        base4.put("item2", String.valueOf(count4));


        Map<String, String> base5 = new HashMap<String, String>();
        base5.put("item1", "不了解企业用人标准");
        base5.put("item2", String.valueOf(count5));

        Map<String, String> base6 = new HashMap<String, String>();
        base6.put("item1", "专业知识、能力水平欠缺");
        base6.put("item2", String.valueOf(count6));

        Map<String, String> base7 = new HashMap<String, String>();
        base7.put("item1", "求职方法与求职技巧掌握不够");
        base7.put("item2", String.valueOf(count7));

        Map<String, String> base8 = new HashMap<String, String>();
        base8.put("item1", "专业不对口");
        base8.put("item2", String.valueOf(count8));

        Map<String, String> base9 = new HashMap<String, String>();
        base9.put("item1", "其他");
        base9.put("item2", String.valueOf(count9));

        listItemsByType.add(base1);
        listItemsByType.add(base2);
        listItemsByType.add(base3);
        listItemsByType.add(base4);
        listItemsByType.add(base5);
        listItemsByType.add(base6);
        listItemsByType.add(base7);
        listItemsByType.add(base8);
        listItemsByType.add(base9);

        // 注意这里的key值
        POIXMLDocumentPart poixmlDocumentPart = chartsMap.get("失业人员求职面临的主要困难");
        new PoiWordTools().replaceBarCharts(poixmlDocumentPart, titleArr, fldNameArr, listItemsByType);
    }

    public void doCharts6(Map<String, POIXMLDocumentPart> chartsMap) {
        // 数据准备
        List<String> titleArr = new ArrayList<String>();// 标题
        titleArr.add("");
        titleArr.add("未就业人员经济压力");

        List<String> fldNameArr = new ArrayList<String>();// 字段名(数据有多少列，就多少个)
        fldNameArr.add("item1");
        fldNameArr.add("item2");
        // 数据集合
        List<Map<String, String>> listItemsByType = new ArrayList<Map<String, String>>();

        QueryWrapper<YouthJobInvestigateModel> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("is_life_stress", "没什么压力");
        Integer count1 = youthJobInvestigateMapper.selectCount(queryWrapper1);


        QueryWrapper<YouthJobInvestigateModel> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("is_life_stress", "有点压力");
        Integer count2 = youthJobInvestigateMapper.selectCount(queryWrapper2);


        QueryWrapper<YouthJobInvestigateModel> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("is_life_stress", "压力很大");
        Integer count3 = youthJobInvestigateMapper.selectCount(queryWrapper3);


        QueryWrapper<YouthJobInvestigateModel> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.like("is_life_stress", "不好说");
        Integer count4 = youthJobInvestigateMapper.selectCount(queryWrapper4);
        YouthJobInvestigateVo vo4 = new YouthJobInvestigateVo();

        // 第一行数据
        Map<String, String> base1 = new HashMap<String, String>();
        base1.put("item1", "没什么压力");
        base1.put("item2", (int) count1 + "");


        // 第二行数据
        Map<String, String> base2 = new HashMap<String, String>();
        base2.put("item1", "有点压力");
        base2.put("item2", (int) count2 + "");


        // 第三行数据
        Map<String, String> base3 = new HashMap<String, String>();
        base3.put("item1", "压力很大");
        base3.put("item2", (int) count3 + "");

        // 第三行数据
        Map<String, String> base4 = new HashMap<String, String>();
        base4.put("item1", "不好说");
        base4.put("item2", (int) count4 + "");


        listItemsByType.add(base1);
        listItemsByType.add(base2);
        listItemsByType.add(base3);
        listItemsByType.add(base4);
        // 注意这里的key值
        POIXMLDocumentPart poixmlDocumentPart = chartsMap.get("未就业人员经济压力");
        new PoiWordTools().replacePieCharts(poixmlDocumentPart, titleArr, fldNameArr, listItemsByType);
    }

    public void doCharts7(Map<String, POIXMLDocumentPart> chartsMap) {
        // 数据准备
        List<String> titleArr = new ArrayList<String>();// 标题
        titleArr.add("");
        titleArr.add("在校生就业方向");

        List<String> fldNameArr = new ArrayList<String>();// 字段名(数据有多少列，就多少个)
        fldNameArr.add("item1");
        fldNameArr.add("item2");
        // 数据集合
        List<Map<String, String>> listItemsByType = new ArrayList<Map<String, String>>();

        QueryWrapper<YouthJobInvestigateModel> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("work_intention", "考公考编");
        Integer count1 = youthJobInvestigateMapper.selectCount(queryWrapper1);


        QueryWrapper<YouthJobInvestigateModel> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("work_intention", "升学");
        Integer count2 = youthJobInvestigateMapper.selectCount(queryWrapper2);


        QueryWrapper<YouthJobInvestigateModel> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("work_intention", "出国");
        Integer count3 = youthJobInvestigateMapper.selectCount(queryWrapper3);


        QueryWrapper<YouthJobInvestigateModel> queryWrapper4 = new QueryWrapper<>();
        queryWrapper4.like("work_intention", "国有企业");
        Integer count4 = youthJobInvestigateMapper.selectCount(queryWrapper4);


        QueryWrapper<YouthJobInvestigateModel> queryWrapper5 = new QueryWrapper<>();
        queryWrapper5.like("work_intention", "私企民企");
        Integer count5 = youthJobInvestigateMapper.selectCount(queryWrapper5);


        QueryWrapper<YouthJobInvestigateModel> queryWrapper6 = new QueryWrapper<>();
        queryWrapper6.like("work_intention", "外企或合资企业");
        Integer count6 = youthJobInvestigateMapper.selectCount(queryWrapper6);


        QueryWrapper<YouthJobInvestigateModel> queryWrapper7 = new QueryWrapper<>();
        queryWrapper7.like("work_intention", "灵活就业或自由职业");
        Integer count7 = youthJobInvestigateMapper.selectCount(queryWrapper7);


        QueryWrapper<YouthJobInvestigateModel> queryWrapper8 = new QueryWrapper<>();
        queryWrapper8.like("work_intention", "自主创业");
        Integer count8 = youthJobInvestigateMapper.selectCount(queryWrapper8);


        QueryWrapper<YouthJobInvestigateModel> queryWrapper9 = new QueryWrapper<>();
        queryWrapper9.like("work_intention", "参军入伍");
        Integer count9 = youthJobInvestigateMapper.selectCount(queryWrapper9);


        QueryWrapper<YouthJobInvestigateModel> queryWrapper10 = new QueryWrapper<>();
        queryWrapper10.like("work_intention", "其他");
        Integer count10 = youthJobInvestigateMapper.selectCount(queryWrapper10);

        // 第一行数据
        Map<String, String> base1 = new HashMap<String, String>();
        base1.put("item1", "考公考编");
        base1.put("item2", (int) count1 + "");


        // 第二行数据
        Map<String, String> base2 = new HashMap<String, String>();
        base2.put("item1", "升学");
        base2.put("item2", (int) count2 + "");


        // 第三行数据
        Map<String, String> base3 = new HashMap<String, String>();
        base3.put("item1", "出国");
        base3.put("item2", (int) count3 + "");

        // 第三行数据
        Map<String, String> base4 = new HashMap<String, String>();
        base4.put("item1", "国有企业");
        base4.put("item2", (int) count4 + "");

        // 第三行数据
        Map<String, String> base5 = new HashMap<String, String>();
        base5.put("item1", "私企民企");
        base5.put("item2", (int) count5 + "");

        // 第三行数据
        Map<String, String> base6 = new HashMap<String, String>();
        base6.put("item1", "外企或合资企业");
        base6.put("item2", (int) count6 + "");

        // 第三行数据
        Map<String, String> base7 = new HashMap<String, String>();
        base7.put("item1", "灵活就业或自由职业");
        base7.put("item2", (int) count7 + "");

        // 第三行数据
        Map<String, String> base8 = new HashMap<String, String>();
        base8.put("item1", "自主创业");
        base8.put("item2", (int) count8 + "");

        // 第三行数据
        Map<String, String> base9 = new HashMap<String, String>();
        base9.put("item1", "参军入伍");
        base9.put("item2", (int) count9 + "");

        Map<String, String> base10 = new HashMap<String, String>();
        base10.put("item1", "其他");
        base10.put("item2", (int) count10 + "");

        listItemsByType.add(base1);
        listItemsByType.add(base2);
        listItemsByType.add(base3);
        listItemsByType.add(base4);
        listItemsByType.add(base5);
        listItemsByType.add(base6);
        listItemsByType.add(base7);
        listItemsByType.add(base8);
        listItemsByType.add(base9);
        listItemsByType.add(base10);
        // 注意这里的key值
        POIXMLDocumentPart poixmlDocumentPart = chartsMap.get("在校生就业方向");
        new PoiWordTools().replacePieCharts(poixmlDocumentPart, titleArr, fldNameArr, listItemsByType);
    }

    public void doCharts8(Map<String, POIXMLDocumentPart> chartsMap) {
        // 数据准备
        List<String> titleArr = new ArrayList<String>();// 标题
        titleArr.add("");
        titleArr.add("人数");

        List<String> fldNameArr = new ArrayList<String>();// 字段名(数据有多少列，就多少个)
        fldNameArr.add("item1");
        fldNameArr.add("item2");
        // 数据集合
        List<Map<String, String>> listItemsByType = new ArrayList<Map<String, String>>();

        // 数据的话随便整都行

        QueryWrapper<YouthJobInvestigateModel> queryWrapper1 = new QueryWrapper<>();
        queryWrapper1.like("graduation_time", "2023年");
        Integer count1 = youthJobInvestigateMapper.selectCount(queryWrapper1);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper2 = new QueryWrapper<>();
        queryWrapper2.like("graduation_time", "2022年");
        Integer count2 = youthJobInvestigateMapper.selectCount(queryWrapper2);
        QueryWrapper<YouthJobInvestigateModel> queryWrapper3 = new QueryWrapper<>();
        queryWrapper3.like("graduation_time", "2021年");
        Integer count3 = youthJobInvestigateMapper.selectCount(queryWrapper3);
        // 第一行数据
        Map<String, String> base1 = new HashMap<String, String>();
        base1.put("item1", "2023年");
        base1.put("item2", String.valueOf(count1));


        // 第二行数据
        Map<String, String> base2 = new HashMap<String, String>();
        base2.put("item1", "2022年");
        base2.put("item2", String.valueOf(count2));


        // 第三行数据
        Map<String, String> base3 = new HashMap<String, String>();
        base3.put("item1", "2021年");
        base3.put("item2", String.valueOf(count3));


        listItemsByType.add(base1);
        listItemsByType.add(base2);
        listItemsByType.add(base3);

        // 注意这里的key值
        POIXMLDocumentPart poixmlDocumentPart = chartsMap.get("近三年登记离校未就业高校毕业生");
        new PoiWordTools().replaceBarCharts(poixmlDocumentPart, titleArr, fldNameArr, listItemsByType);
    }


}
